package zzuli.edu.cn.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @ApiIgnore 注解用于类、方法、方法参数，表示这个类、方法或参数被忽略
 */
@Api(value = "@ApiIgnore注解测试", tags = "@ApiIgnore注解测试")
@RestController
public class Swagger2Controller2 {

    /**
     * 此方法的API接口会被忽略
     */
    @ApiIgnore
    @ApiOperation(value = "ApiIgnore测试1", notes = "此方法用于@ApiIgnore测试")
    @PostMapping("/apiIgnore")
    public String ApiIgnoreTest(@ApiParam(name = "username", value= "用户名", required = true) String username,
                              String password) {
        return username + password;
    }

    /**
     * 此方法的参数password会被忽略
     */
    @ApiOperation(value = "ApiIgnore测试2", notes = "此方法用于@ApiIgnore测试")
    @PostMapping("/apiIgnore2")
    public String ApiIgnoreTest2(@ApiParam(name = "username", value= "用户名", required = true) String username,
                                @ApiIgnore @ApiParam(name = "password", value = "密码", required = true) String password) {
        return username + password;
    }

}
